<?php
/**
* @package YARBB
* @copyright Авторские права (C) 2009 www.yar-it.com. Все права защищены.
* @license Лицензия http://www.gnu.org/licenses/gpl-2.0.htm GNU/GPL, или help/license.php
* YARBB! - свободное программное обеспечение распространяемое по условиям лицензии GNU/GPL
* Для получения информации о используемых расширениях и замечаний об авторском праве, смотрите файл copyright.php.
*/
// no direct access
defined( '_VALID_MOS' ) or die();

define('YARBB_ALLOW_INDEX', 1);

$id = intval(mosGetParam($_GET, 'id', 0));

if ($id < 1){
	mosRedirect(sefRelToAbs(YARBB_URL), _Y_404);
}

$sql = 'SELECT f.forum_name, f.forum_desc, f.forum_mdesc, f.forum_key, pf.forum_name AS parent_forum, f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, f.parent_forum_id, fp.post_topics
	FROM #__forum_forums AS f
	LEFT JOIN #__forum_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$yarbb_user['g_id'].')
	LEFT JOIN #__forum_forums AS pf ON f.parent_forum_id=pf.id
	WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id;
$cur_forum = $database->setQuery($sql)->loadAssocRow();

//$cur_forum = $cur_forum[0];

// форум не существует
if(!$cur_forum){
	mosRedirect(sefRelToAbs(YARBB_URL), _Y_404);
}

// редиректим если тип форума соответствубщий
if ($cur_forum['redirect_url'] != ''){
	mosRedirect($cur_forum['redirect_url']);
}

// установки мета-тэгов
$mainframe->setPageTitle( yarbb_htmlspecialchars($cur_forum['forum_name']) );
$mainframe->appendMetaTag ( 'keywords', yarbb_htmlspecialchars($cur_forum['forum_key']) );
$mainframe->appendMetaTag ( 'description', yarbb_htmlspecialchars($cur_forum['forum_mdesc']) );


// проверяем модеров
$mods_array = array();
if ($cur_forum['moderators'] != ''){
	$mods_array = unserialize($cur_forum['moderators']);
}
// проверяем, админ ли текущий пользователь
$is_admmod = ($yarbb_user['g_id'] == YARBB_ADMIN || ($yarbb_user['g_id'] == YARBB_MOD && array_key_exists($yarbb_user['username'], $mods_array)) || $yarbb_user['g_global_moderation']) ? true : false;

// кнопка создания новой темы
$post_link = '';

// отмечаем новые сообщения
if (($cur_forum['post_topics'] == '' && $yarbb_user['g_post_topics'] == '1') || $cur_forum['post_topics'] == '1' || $is_admmod) {
        $post_link = "\t\t".'<p class="postlink conr"><span class="button"><button onclick="document.location=\''.sefRelToAbs(YARBB_URL.'&amp;task=post&amp;fid='.$id).'\';" title="'._Y_YARNEWTOP.'">'._Y_YARNEWTOP."</button></span>\n";

}

// разделяем страницы, boston'у ТУТ интересно
$num_pages = ceil($cur_forum['num_topics'] / $yarbb_user['disp_topics']);
$p = intval(mosGetParam($_GET, 'page', 1));
$p = ($p > $num_pages) ? 1 : $p;
$start_from = $yarbb_user['disp_topics'] * ($p - 1);

$page_title = yarbb_htmlspecialchars($yarbb_config['o_board_title'].' / '.$cur_forum['forum_name']);
// ссылки на постраничку
$paging_links = _PN_PAGE.': '.paginate($num_pages, $p, YARBB_URL.'&amp;task=viewforum&amp;id='.$id);

$sql = 'SELECT forum_desc, forum_key, forum_mdesc, forum_name, id, last_post, last_post_id, last_poster, moderators, num_posts, num_topics, redirect_url
FROM #__forum_forums
WHERE parent_forum_id='.$id.'
ORDER BY disp_position';
$subforum_result = $database->setQuery($sql)->loadAssocList();

if($subforum_result) {?>
<div class="linkst">
	<div class="inbox">
		<div class="yarpathway"><a href="<?php echo sefRelToAbs(YARBB_URL)?>"><?php echo _Y_INDEX; ?></a>&nbsp;</div><div class="yarpathway_2">&raquo;&nbsp;<?php echo yarbb_htmlspecialchars($cur_forum['forum_name']) ?></div>
		<div class="clearer"></div>
	</div>
</div>
<div id="vf" class="blocktable">
	<h2><span class="brdcolor2"><?php echo _Y_PARENTFORUM; ?></span></h2>
	<div class="box">
		<div class="inbox">
			<table cellspacing="0">
			<thead>
				<tr>
					<th class="tcl" scope="col"><?php echo _Y_FORUMS; ?></th>
					<th class="tc2" scope="col"><?php echo _Y_TOPICS; ?></th>
					<th class="tc3" scope="col"><?php echo _Y_REPLYSY; ?></th>
					<th class="ag_tcr" scope="col"><?php echo _Y_LASTPOST; ?></th>
				</tr>
			</thead>
			<tbody>
<?php
// вывод подфорумов
foreach($subforum_result as $cur_subforum){
	$item_status = '';
	$icon_type = 'icon';
	// Are there new posts?
	if (!$yarbb_user['is_guest'] && $cur_subforum['last_post'] > $yarbb_user['last_visit']){
		$item_status = 'inew';
		$icon_type = 'icon inew';
	}
	// Is this a redirect forum?
	if ($cur_forum['redirect_url'] != ''){
		$forum_field = '<h3><a href="'.yarbb_htmlspecialchars($cur_subforum['redirect_url']).'" title="'._Y_LINKTO.' '.yarbb_htmlspecialchars($cur_subforum['redirect_url']).'" class="subforum_name">'.yarbb_htmlspecialchars($cur_subforum['forum_name']).'</a></h3>';
		$num_topics = $num_posts = '&nbsp;';
		$item_status = 'iredirect';
		$icon_type = 'icon';
	}else{
		$forum_field = '<h3><a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewforum&amp;id='.$cur_subforum['id']).'" title="'.yarbb_htmlspecialchars($cur_subforum['forum_name']).'" class="subforum_name">'.yarbb_htmlspecialchars($cur_subforum['forum_name']).'</a></h3>';
		$num_topics = $cur_subforum['num_topics'];
		$num_posts = $cur_subforum['num_posts'];
	}
	if ($cur_subforum['forum_desc'] != ''){
		$forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_subforum['forum_desc'];
	}
	// Ссылка на последний пост.
	if ($cur_subforum['last_post'] != ''){
//добавляем номер страницы темы
$sql = 'SELECT t.num_replies
			FROM #__forum_topics AS t 
			INNER JOIN #__forum_forums AS f ON f.id='.$cur_subforum['id'].' 
			LEFT JOIN #__forum_posts AS p ON t.id=p.topic_id AND p.poster_id='.$yarbb_user['id'].' 
			WHERE (t.last_post_id='.$cur_subforum['last_post_id'].') 
			';
$cur_topic_result = $database->setQuery($sql)->loadResult();			
$num_pages_topic = ceil(($cur_topic_result + 1) / $yarbb_user['disp_posts']);

$last_post = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;page='.$num_pages_topic.'&amp;pid='.$cur_subforum['last_post_id']).'#p'.$cur_subforum['last_post_id'].'" class="last_post">'.format_time($cur_subforum['last_post']).'</a> <span class="byuser">'._Y_YARBY.' '.yarbb_htmlspecialchars($cur_subforum['last_poster']).'</span>';
//\добавляем номер страницы темы		
		//$last_post = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;pid='.$cur_subforum['last_post_id']).'#p'.$cur_subforum['last_post_id'].'" class="last_post">'.format_time($cur_subforum['last_post']).'</a> <span class="byuser">'._Y_YARBY.' '.yarbb_htmlspecialchars($cur_subforum['last_poster']).'</span>';
		
	}else{
	
		$last_post = '&nbsp;';
	}
	if ($cur_subforum['moderators'] != ''){
		$mods_array = unserialize($cur_subforum['moderators']);
		$moderators = array();
		while (list($mod_username, $mod_id) = @each($mods_array)){
			$moderators[] = '<a href="'.sefRelToAbs('index.php?option=com_users&task=profile&amp;user='.$mod_id).'"  class="moderators">'.yarbb_htmlspecialchars($mod_username).'</a>';
		}
		$moderators = "\t\t\t\t\t\t\t\t".'<p><em>('._Y_MODERATORS.'</em> '.implode(', ', $moderators).')</p>'."\n";
	}
	?>
				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).' '.$rowbg.'"'; else echo ' class="'.$rowbg.'"'; ?>>
					<td class="tcl">
						<div class="intd">
							<div class="<?php echo $icon_type ?>"></div>
							<div class="tclcon">
								<?php echo $forum_field."\n".$moderators ?>
							</div>
						</div>
						</td>
					<td class="tc2"><?php echo $num_topics ?></td>
					<td class="tc3"><?php echo $num_posts; ?></td>
					<td class="ag_tcr"><?php echo $last_post ?></td>
				</tr>
<?php
}
?>
			</tbody>
			</table>
		</div>
	</div>
</div>
<?php
}
?>
<div class="linkst">
	<div class="inbox">
		<p class="pagelink conl"><?php echo $paging_links ?></p>
<?php
echo $post_link;
if ($cur_forum['parent_forum']){
	echo "\t\t".'<div class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL).'">'._Y_INDEX.'</a>&nbsp;&raquo; <span class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewforum&amp;id='.$cur_forum['parent_forum_id']).'">'.yarbb_htmlspecialchars($cur_forum['parent_forum']).'</a>&nbsp;&raquo; '.$yarforumname.'</span></div>';
}else{
	echo "\t\t".'<div class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL).'">'._Y_INDEX.'</a>&nbsp;&raquo; <span class="yarpathway">'.$cur_forum['forum_name'].'</span></div>';
}
?>
	</div>
</div>

<div id="vf" class="blocktable">
	<h2>
		<span class="brdcolor2"><?php echo yarbb_htmlspecialchars($cur_forum['forum_name']); ?></span>
	</h2>
<?php
	// вывод анонса-объявления форума
	$annonce = null;
	$sql = 'SELECT forum_annonce, forum_annonce_visible FROM  #__forum_annonces WHERE forum_id='.$id;
	$database->setQuery($sql)->loadObject($annonce);

	if (($annonce)&&($annonce->forum_annonce_visible)){?>
		<div id="announce" class="block">
			<h2><span class="brdcolor2"><?php echo _Y_YARANONONAP; ?></span></h2>
			<div class="box">
				<div class="inbox"><?php echo $annonce->forum_annonce; ?></div>
			</div>
		</div>
<?php
		unset($annonce);
	}
?>
	<div class="box">
		<div class="inbox">
			<table width="100%" cellspacing="0">
			<thead>
				<tr>
					<th class="tcl" scope="col">
						<div align="left"><?php echo _Y_TOPICS; ?></div>
					</th>
					<th class="tc2" scope="col"><?php echo _Y_REPLYSY; ?></th>
					<th class="tc3" scope="col"><?php echo _Y_YARVIEWTOP; ?></th>
					<th class="ag_tcr" scope="col"><?php echo _Y_LASTPOST; ?></th>
				</tr>
			</thead>
			<tbody>
<?php
// Fetch list of topics to display on this page
if ($yarbb_user['is_guest'] || $yarbb_config['o_show_dot'] == 0){
	$sql = 'SELECT id, poster, subject, descrip_t, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to, icon_topic, labels FROM #__forum_topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$yarbb_user['disp_topics'];
}else{
	$sql = 'SELECT p.poster_id AS has_posted, t.id, t.subject, t.descrip_t, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, t.icon_topic, t.labels FROM #__forum_topics AS t LEFT JOIN #__forum_posts AS p ON t.id=p.topic_id AND p.poster_id='.$yarbb_user['id'].' WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$yarbb_user['disp_topics'];

}
 $cur_topics = $database->setQuery($sql)->loadAssocList();


// If there are topics in this forum.
if(count($cur_topics)>0){
	foreach($cur_topics as $cur_topic){
		$item_status = '';
		$icon_type = 'icon';
		if ($cur_topic['moved_to'] == null){
//добавляем номер страницы темы		
$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $yarbb_user['disp_posts']);

$last_post = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;page='.$num_pages_topic.'&amp;pid='.$cur_topic['last_post_id']).'#p'.$cur_topic['last_post_id'].'" class="last_post">'.format_time($cur_topic['last_post']).'</a><br /> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['last_poster']).'</span>';
//\добавляем номер страницы темы			
			//$last_post = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;pid='.$cur_topic['last_post_id']).'#p'.$cur_topic['last_post_id'].'" class="last_post">'.format_time($cur_topic['last_post']).'</a><br /> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['last_poster']).'</span>';
		}else{
			$last_post = '&nbsp;';
		}
		if ($yarbb_config['o_censoring'] == '1'){
			$cur_topic['subject'] = censor_words($cur_topic['subject']);
		}
		if ( isset($cur_topic['question']) && $cur_topic['question']!= '') {
			if ($yarbb_config['o_censoring'] == '1'){
				$cur_topic['question'] = censor_words($cur_topic['question']);
			}
		
			if (!$yarbb_user['is_guest'] && $cur_topic['last_post'] > $yarbb_user['last_visit'] && $cur_topic['moved_to'] == null){
				$item_status .= ' inew';
				$icon_type = 'icon inew';
	
				$subject = '<strong>'.$subject.'</strong>';
				$subject_new_posts = '<span class="newtext">[&nbsp;<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id'].'&amp;action=new').'" title="'._Y_YAGOTONEWTOP.'" class="subject"><img src="'.$yarbb_live.'/style/images/'.$yarbb_config['o_default_style'].'/folder/folder_new_hot.gif" alt="'._Y_YARNEWPOSTS22.'"/></a>&nbsp;]</span>';
			}else{
				$subject_new_posts = null;
			}

			// Should we display the dot or not? :)
			if (!$yarbb_user['is_guest'] && $yarbb_config['o_show_dot'] == 1){
				if ($cur_topic['has_posted'] == $yarbb_user['id']){
					$subject = '<strong>&middot;</strong>&nbsp;'.$subject;
				}else{
					$subject = '&nbsp;&nbsp;'.$subject;
				}
			}
		}else{
			////////////////////////////////////////////////////////////////
			if ($cur_topic['moved_to'] != 0){
				$subject = _Y_FRONTMOVED.': <a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['moved_to']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
			}else if ($cur_topic['closed'] == '0'){
				$subject = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
			}else{
				$subject = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
				$item_status = 'iclosed';
			}
			if (!$yarbb_user['is_guest'] && $cur_topic['last_post'] > $yarbb_user['last_visit'] && $cur_topic['moved_to'] == null){
				$item_status .= ' inew';
				$icon_type = 'icon inew';
				$subject = '<strong>'.$subject.'</strong>';
				$subject_new_posts = '<span class="newtext">[&nbsp;<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id'].'&amp;action=new').'" title="'._Y_YAGOTONEWTOP.'" class="subject"><img src="'.$yarbb_live.'/style/images/'.$yarbb_config['o_default_style'].'/folder/folder_new_hot.gif" alt="'._Y_YARNEWPOSTS22.'"/></a>&nbsp;]</span>';
			}else{
				$subject_new_posts = null;
			}
			// Should we display the dot or not? :)
			if (!$yarbb_user['is_guest'] && $yarbb_config['o_show_dot'] == '1'){
				if ($cur_topic['has_posted'] == $yarbb_user['id']){
					$subject = '<strong>&middot;</strong>&nbsp;'.$subject;
				}else{
					$subject = '&nbsp;&nbsp;'.$subject;
				}
			} else {
			if ($cur_topic['moved_to'] != 0){
				$subject = _Y_FRONTMOVED.': <a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['moved_to']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
			}else if ($cur_topic['closed'] == '0'){
				$subject = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
			}else{
				$subject = '<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id']).'" title="'.yarbb_htmlspecialchars($cur_topic['subject']).'" class="subject">'.yarbb_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'._Y_YARBY.'&nbsp;'.yarbb_htmlspecialchars($cur_topic['poster']).'</span>';
				$item_status = 'iclosed';
			}
			if (!$yarbb_user['is_guest'] && $cur_topic['last_post'] > $yarbb_user['last_visit'] && $cur_topic['moved_to'] == null){
				$item_status .= ' inew';
				$icon_type = 'icon inew';
				$subject = '<strong>'.$subject.'</strong>';
				$subject_new_posts = '<span class="newtext">&nbsp;<a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewtopic&amp;pid='.$cur_topic['last_post_id']).'#p'.$cur_topic['last_post_id'].'" title="'._Y_YAGOTONEWTOP.'" class="subject"><img src="'.$yarbb_live.'/theme/'.$yarbb_config['o_default_style'].'/images/new_posts.png" alt="'._Y_YARNEWPOSTS22.'"/></a>&nbsp;</span>';
			}else{
				$subject_new_posts = null;
			}
			// Should we display the dot or not? :)
			if (!$yarbb_user['is_guest'] && $yarbb_config['o_show_dot'] == '1'){
				if ($cur_topic['has_posted'] == $yarbb_user['id']){
					$subject = '<strong>&middot;</strong>&nbsp;'.$subject;
				}else{
					$subject = '&nbsp;&nbsp;'.$subject;
				}
			}
			}
		}
		// прикреплённая тема
		if ($cur_topic['sticky'] == '1'){
			$subject = '<span class="stickytext">'._Y_YARSTIKY.': </span>'.$subject;
			$item_status .= ' isticky';
		}
		if ($cur_topic['icon_topic'] != 0){
			$icon_topic = '<img src="'.$yarbb_live.'/images/icons/'.$cur_topic['icon_topic'].'.gif" alt="'.$cur_topic['icon_topic'].'.gif" class="yar_iconfolder" />';
			$subject = $icon_topic.' '.$subject;
		}
		// постраничка для сообщений темы
		$num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $yarbb_user['disp_posts']);
		if ($num_pages_topic > 1){
			$subject_multipage = '[ '.paginate($num_pages_topic, -1, YARBB_URL.'&amp;task=viewtopic&amp;id='.$cur_topic['id']).' ]';
		}else{
			$subject_multipage = null;
		}
		// Should we show the "New posts" and/or the multipage links?
		if (!empty($subject_new_posts) || !empty($subject_multipage)){
			$subject .= '&nbsp; '.(!empty($subject_new_posts) ? $subject_new_posts : '');
			$subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
			$rowbg = ( isset($rowbg) && $rowbg == 'even') ? 'odd' : 'even';
		}
		$labels = (!empty($yarbb_config['o_topic_labels']))? $cur_topic['labels']: '';

?>
				<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
					<td class="tcl">
						<div class="intd">
							<div class="<?php echo $icon_type ?>"></div>
							<div class="tclcon">
								<?php echo $subject ?><br />
								<?php echo yarbb_htmlspecialchars($cur_topic['descrip_t']); ?><br />
							</div>
						</div>
						<?php if (!empty($labels)){ echo '<div class="topiclabels">'._Y_TAGS.': ['. show_labels($labels) . ']</div>'; }?>
					</td>
					<td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : '&nbsp;' ?></td>
					<td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : '&nbsp;' ?></td>
					<td class="tcr"><?php echo $last_post ?></td>
				</tr>
<?php
	}
}else{
// тем нету
?>
				<tr>
					<td class="tcl" colspan="6"><?php echo _Y_BANNONE; ?></td>
				</tr>
<?php
}
unset($cur_topics,$cur_topic);
?>
			</tbody>
			</table>
		</div>
	</div>
</div>
<div class="linkst">
	<div class="inbox">
		<p class="pagelink conl"><?php echo $paging_links ?></p>
<?php
echo $post_link;
if ($cur_forum['parent_forum']){
	echo "\t\t".'<div class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL).'">'._Y_INDEX.'</a>&nbsp;&raquo; <span class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL.'&amp;task=viewforum&amp;id='.$cur_forum['parent_forum_id']).'">'.yarbb_htmlspecialchars($cur_forum['parent_forum']).'</a>&nbsp;&raquo;&nbsp;'.$yarforumname.'</span></div>';
}else{
	echo "\t\t".'<div class="yarpathway"><a href="'.sefRelToAbs(YARBB_URL).'">'._Y_INDEX.'</a>&nbsp;&raquo;<span class="yarpathway">'.$cur_forum['forum_name'].'</span></div>';
}
?>
	</div>
</div>
<?php
$forum_id = $id;
$footer_style = 'viewforum';